import {v4 as uuidv4} from 'uuid'

//封装游客临时id UUID
export const getUUID=()=>{
    //先从localstorage中获取uuid
    let uuid_token=localStorage.getItem('UUIDTOKEN')
    if(!uuid_token){
        uuid_token=uuidv4();
        //将uuid保存到本地存储中
        localStorage.setItem('UUIDTOKEN',uuid_token);
    }
    return uuid_token;
}